package com.soul.dj.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.WindowManager;
import android.widget.ImageView;
import com.soul.dj.MainApplication;
import com.soul.dj.R;
import com.soul.dj.util.Const;

import java.io.File;

/**
 * 首页
 *
 * @author soul
 */
public class SplashActivity extends BaseActivity {


	private ImageView adView;



	@Override
	protected void initView() {
		setContentView(R.layout.splash_activity);
		//全屏
		getWindow().setFlags(WindowManager.LayoutParams. FLAG_FULLSCREEN ,
				WindowManager.LayoutParams. FLAG_FULLSCREEN);

		/**
		 * 图片缓存目录建立
		 */
		File filePath = new File(Const.IMAGE_PATH);
		if (!filePath.exists()) {
			filePath.mkdir();
		}


		Handler handler = new Handler();
		handler.postDelayed(new Splashhandler(), 1000);


		adView = (ImageView)findViewById(R.id.ad);



	}


	class Splashhandler implements Runnable {
		public void run() {


			Intent intent = new Intent(SplashActivity.this,
					LoginActivity.class);
			startActivity(intent);
			MainApplication.removeActivity(SplashActivity.this);

		}
	}

}
